package com.zbkj.crmeb.order.request;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.utils.jackyun.BaseRequestBizData;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class JkyOrderPushRequest {

    @ApiModelProperty(name = "method")
    private String method;

    @ApiModelProperty(name = "format")
    private String format;

    @ApiModelProperty(name = "content")
    private Content content;

    @ApiModelProperty(name = "timestamp")
    private String timestamp;

    @ApiModelProperty(name = "customerid")
    private String customerid;

    @ApiModelProperty(name = "sign")
    private String sign;


    @Data
    public static class Content {

        @JSONField(name ="deliveryOrder")
        private DeliveryOrder deliveryOrder;

        @JSONField(name ="orderLines")
        private List<OrderLines> orderLines;

    }

    @Data
    public static class DeliveryOrder {

        private String deliveryOrderCode;

        private String warehouseCode;

        @JsonFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
        private Date createTime;

        @JsonFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
        private Date payTime;

        private SenderInfo senderInfo;

        private ReceiverInfo receiverInfo;

        private String payNo;

        private BigDecimal totalAmount;

        private BigDecimal  taxAmount;

        private BigDecimal itemAmount;

        private BigDecimal freight;

        private String  buyerName;

        private String idcard;

        private String remark;


    }

    @Data
    public static class SenderInfo {

        private String name;
        private String mobile;
        private String countryCode;

        private String province;

        private String city;

        private String area;

        private String town;

        private String detailAddress;

    }

    @Data
    public static class ReceiverInfo {

        private String name;
        private String mobile;
        private String countryCode;

        private String province;

        private String city;

        private String area;

        private String town;

        private String detailAddress;

        private Integer idType;

        private String idNumber;

    }

    @Data
    public static class OrderLines {

        private String orderLineNo;
        private String ownerCode;
        private String itemCode;
        private String itemId;
        private String itemName;
        private Integer planQty;
        private String sourceOrderCode;

        //当前价格
        private BigDecimal actualPrice;
        //零售价格
        private BigDecimal retailPrice;
    }

}
